home *** CD-ROM | disk | FTP | other *** search
/ NeXT Education Software Sampler 1992 Fall / NeXT Education Software Sampler 1992 Fall.iso / Programming / c-runtime / tests / 23Nov91.perf.short.hash.indexes < prev    next >
Encoding:
Text File  |  1991-11-24  |  2.0 KB  |  58 lines

  1. If you see this message then SubClass1 received a +initialize method
  2. If you see this message then SubClass2 received a +initialize method
  3. If you see this message then SubClass3 received a +initialize method
  4. Subclass1 print
  5. Subclass1 print:this is a message sent to a instance of SubClass1 in a weird way
  6. obj=SubClass1, ivar=dumb, offset=4, obj size=22 (should be 22)
  7. SubClass2 print
  8. SubClass2 print:a message
  9. SubClass2 print:this is a message sent to a instance of SubClass2 in a weird way
  10. obj=SubClass2, ivar=dumb, offset=4, obj size=28 (should be 28)
  11. SubClass2 print
  12. SubClass2 print:This message comes to you from SubClass3 forwarded to it's super class, msg=a message
  13.  
  14. SubClass2 print:This message comes to you from SubClass3 forwarded to it's super class, msg=this is a message sent to a instance of SubClass2 in a weird way
  15.  
  16. obj=SubClass3, ivar=smart, offset=28, obj size=32 (should be 32)
  17. a message from SubClass3, additionalClassMethod, First_Test category.
  18. a message from SubClass3, additionalClassMethodTwo, Second_Test category.
  19. Exit, the tests worked! (you did compile with -DDEBUG -UNDEBUG didn't you?)
  20.  
  21.  
  22. Some performance data:
  23.  
  24. for( i = 0; i < ITERATIONS; ++i )
  25.   func();
  26. 1000000 iterations, 1 sec (1e+06/sec)
  27.  
  28. for( i = 0; i < ITERATIONS; ++i )
  29.   [[ Object new ] free ];
  30. 1000000 iterations, 66 sec (15151.515152/sec)
  31.  
  32. for( i = 0; i < ITERATIONS; ++i )
  33.   [[ SubClass2 new ] free ];
  34. (super class must be searched for +new)
  35. 1000000 iterations, 89 sec (11235.955056/sec)
  36.  
  37. for( i = 0; i < ITERATIONS; ++i )
  38.   [[ SubClass2 newOther ] free ];
  39. (+newOther calls +new in its super class)
  40. 1000000 iterations, 96 sec (10416.666667/sec)
  41.  
  42. aObj = [ Object new ];
  43. for( i = 0; i < ITERATIONS; ++i )
  44.   [ aObj self ];
  45. 1000000 iterations, 8 sec (125000/sec)
  46.  
  47. aObj = [ SubClass3 new ];
  48. for( i = 0; i < ITERATIONS; ++i )
  49.   [ aObj self ];
  50. (-self is implemented two classes up)
  51. 1000000 iterations, 6 sec (166666.666667/sec)
  52.  
  53. aObj = [ SubClass3 new ];
  54. for( i = 0; i < ITERATIONS; ++i )
  55.   [[ aObj self ] self ];
  56. 1000000 iterations, 13 sec (76923.076923/sec)
  57.  
  58.